package com.github.xiaolyuh.constant;

import java.math.BigDecimal;

/**
 * redis常量
 */
public class Constant {
    public static final Integer ZERO = 0;
    public static final Long ONE = 1L;

    public static final Integer ACTIVITY_BATCH_REDIS_SIZE = 200;

    public static final Integer INIT_ONE = 1;

    /**
     * 重试次数
     */
    public static final Integer RETRY_TIMES = 3;

    /**
     * 价格共享次数
     */
    public static final Object PROMOTION_PRICE_SHARE_QTY = "promo:p:s";

    /**
     * GB价格实例
     */
    public static final String PRICE_REDIS_NAMESPACE = "_price";

    /**
     * GB优惠券实例
     */
    public static final String COUPON_REDIS_NAMESPACE = "_coupon";

    /**
     * GB活动实例
     */
    public static final String ACTIVITY_REDIS_NAMESPACE = "_activity";

    /**
     * 分隔符
     */
    public static final String SEPAREATOR_CHARACTER = ":";
    /**
     * 删除标识
     */
    public static final String DELETE = SEPAREATOR_CHARACTER + "d";
    /**
     * 缓存默认过期时间(72小时，单位：秒)
     */
    public static final int CACHE_DEFALUT_TIMEOUT = 72 * 60 * 60;
    /**
     * 24小时(单位：秒)
     */
    public static final int TWENTYFOUR_HOUR_TIME = 24 * 60 * 60;
    /**
     * 缓存防刷过期时间
     */
    public static final int CACHE_BRUSH_TIMEOUT = 5;
    /**
     * 防刷次数
     */
    public static final int CACHE_BRUSH_COUNT = 3;
    /**
     * 默认分割线
     */
    public static final String DEFAULT_LINE = "-";
    /**
     * 价格 key前缀
     */
    public static final String PROMOTION_PRICE = "promo:p";
    /**
     * coupon模板限制发放的总数量
     */
    public static final String GRANT_TOTAL_COUNT = "grantTotalCount";
    /**
     * coupon模板限制发放的单用户数量
     */
    public static final String GRANT_USER_COUNT = "grantUserCount";
    /**
	 * 系统coupon是否展示
	 */
	public static final String COUPON_SHOW="couponShow";
    /**
     * 价格优先级 key前缀
     */
    public static final String PROMOTION_PRICE_PRIORITY = "promo:pr";

    /**
     * coupon模板发放次数前缀(老版本发放总是和单用户发放总数前缀)
     */
    public static final String COUPON_TEMPLATE_COUNT_INFO = "promo:t:c";

    /**
     *  coupon模板发放总数前缀(多时段领取设置需求后的前缀)
     */
    public static final String COUPON_TEMPLATE_TOTAL_COUNT_INFO ="promo:t:tc";
    /**
     * coupon 使用次数 key前缀
     */
    public static final String PROMOTION_COUPON_USER_COUNTER = "promo:c:c";

    public static final String PROMOTION_GIVE_COUPON_PRIFX = "promo:g";
    /**
     * 配件使用数量前缀
     */
    public static final String PARTS_COUNT_INFO = "promo:pt:c";
    /**
     * 配件
     */
    public static final String PROMOTION_PARTS = "promo:pt";
    /**
     * 价格使用次数
     */
    public static final String PROMOTION_PRICE_USER_COUNTER = "promo:p:c";
    /**
     * 支付后价格使用次数
     */
    public static final String PROMOTION_PAY_PRICE_USER_COUNTER = "promo:p:p:c";
    /**
     * 奖品使用次数
     */
    public static final String PROMOTION_PRIZE_COUNTER = "promo:r:p:c";
    /**
     * 奖品单日抽取使用上限
     */
    public static final String PROMOTION_PRIZE_DAY_USE_COUNTER = "promo:r:p:c:d";
    /**
     * 奖品用户使用上限
     */
    public static final String PROMOTION_PRIZE_USE_COUNTER = "promo:r:p:c:u";
    /**
     * 奖品锁
     */
    public static final String PROMOTION_RAFFLE_PRIZE_LOCK = "promo:r:p:l";
    /**
     * 支付折扣
     */
    public static final String PAY_DISCOUNTS = "promo:pay";

    /**
     * 奖品使用总数
     */
    public static final String PRIZE_COUNT = "totalCount";
    /**
     * 通用使用次数
     */
    public static final String PROMOTION_COUNT_LOG = "promo:c:l";
    /**
     * 后置礼包前缀
     */
    public static final String PROMOTION_RAFFLE_POST_PACKAGE = "promo:r:pp";
    /**
     * 抽奖key前缀
     */
    public static final String PROMOTION_RAFFLE = "promo:r";
    /**
     * 中奖key前缀
     */
    public static final String PROMOTION_RAFFLE_PRIZE = "promo:r:p";
    /**
     * 抽奖模拟中奖名单前缀
     */
    public static final String PROMOTION_RAFFLE_RECEIVE_LOG = "promo:r:r:l";
    /**
     * 用户中奖key前缀
     */
    public static final String PROMOTION_RAFFLE_PRIZE_USER = "promo:r:p:u";
    /**
     * 抽奖用户参与次数
     */
    public static final String PROMOTION_RAFFLE_USER_COUNTER = "promo:r:u:c";
    /**
     * 抽奖用户锁
     */
    public static final String PROMOTION_RAFFLE_LOCK = "promo:r:l";
    /**
     * 满赠赠送抽奖次数/支付金额兑换赠送抽奖次数
     */
    public static final String PROMOTION_ACTIVITY_USER = "promo:r:u";
    /**
     * 用户单日赠送抽奖次数
     */
    public static final String PROMOTION_RAFFLE_GIVE_DAY_USE_COUNTER = "promo:r:g:d:u:c";
    /**
     * 用户赠送抽奖次数
     */
    public static final String PROMOTION_RAFFLE_GIVE_USE_COUNTER = "promo:r:g:u:c";
    /**
     * 分享抽奖活动的次数
     */
    public static final String PROMOTION_RAFFLE_SHARE = "promo:r:s";
    /**
     * 积分兑换抽奖活动的次数
     */
    public static final String PROMOTION_RAFFLE_INTEGRAL_EXCHANGE = "promo:r:i:e";
    /**
     * 集赞兑换次数
     */
    public static final String PROMOTION_RAFFLE_PRAISE = "promo:r:praise";
    /**
     * 订单兑换抽奖次数
     */
    public static final String PROMOTION_RAFFLE_ORDER = "promo:r:o";
    /**
     * 营销活动key前缀
     */
    public static final String PROMOTION_ACTIVITY = "promo:a";
    /**
     * 店铺可参与活动key前缀
     */
    public static final String PROMOTION_ACTIVITY_SHOP = "promo:a:s";

    /**
     * 营销配置key前缀
     */
    public static final String PROMOTION_CONFIGURE_EFFECT_ACTIVITY = "promo:conf:c:effect:";

    /**
     * 营销配置key前缀
     */
    public static final String PROMOTION_CONFIGURE_COMPLIMENTARY_NODE = "promo:conf:c:complimentary:";
    /**
     * 营销仓库活动key前缀
     */
    public static final String PROMOTION_ACTIVITY_WAREHOUSE = "promo:a:w";
    /**
     * 营销仓库活动商品key前缀
     */
    public static final String PROMOTION_ACTIVITY_WAREHOUSE_GOODS = "promo:a:w:g";
    /**
     * 营销活动参与次数key前缀
     */
    public static final String PROMOTION_ACTIVITY_CNT = "promo:a:c";

    /**
     * 营销活动规则参与次数key前缀
     */
    public static final String PROMOTION_ACTIVITY_RULE_CNT="promo:a:ar:c";
    /**
     * 营销活动商品参与次数key前缀
     */
    public static final String PROMOTION_ACTIVITY_GOODSN_CNT = "promo:a:g:c";
    /**
     * 订单回调次数key前缀
     */
    public static final String PROMOTION_ORDER_CALLBACK = "promo:o:";
    /**
     * 订单支付后回调次数key前缀
     */
    public static final String PROMOTION_ORDER_PAY_CALLBACK = "promo:o:p:";
    /**
     * 预售价格变动临界值
     */
    public static final String PRE_SALE_PRICE_CRITICAL = "critical";
    /**
     * 预售价格变动区间
     */
    public static final String PRE_SALE_PRICE_ORDER_CHANGE = "orderChange";
    /**
     * 预售价格:当前订单数量（用于订单操作）
     */
    public static final String PRE_SALE_PRICE_ORDER_TOTAL = "total";
    /**
     * coupon、配件已使用总次数、模板已发放总数量
     */
    public static final String TOTAL_COUNT = "totalCount";
    /**
     * coupon使用次数
     */
    public static final String USER_COUNT = "useCount";
    /**
     * web链接
     *
     * @return
     */
    public static final String WEB_LIINK = "webLink";
    /**
     * wap链接
     *
     * @return
     */
    public static final String WAP_LINK = "wapLink";
    /**
     * android链接
     *
     * @return
     */
    public static final String ANDROID_LINK = "androidLink";
    /**
     * ios链接
     *
     * @return
     */
    public static final String IOS_LINK = "iosLink";
    /**
     * pad链接
     *
     * @return
     */
    public static final String PAD_LINK = "padLink";

    /**
     * 价格使用总次数
     */
    public static final String PRICE_COUNT = "totalCount";
    /**
     * 抽奖使用总次数
     */
    public static final String RAFFLE_COUNT = "totalCount";
    /**
     * coupon初始化使用数量
     */
    public static final String INIT_COUNT = "0";
    /**
     * 空值
     */
    public static final String NIL_STRING = "nil";
    /**
     * 空值
     */
    public static final byte[] NIL_BYTES = "nil".getBytes();
    /**
     * 空值
     */
    public static final byte[] NULL_BYTES = "nil".getBytes();
    /**
     * 字节1
     */
    public static final Byte ONE_BYTE = Byte.valueOf("1");
    /**
     * 生效起止时间
     */
    public static final Short TIME_DATE_TYPE = 1;
    /**
     * 生效时长
     */
    public static final Short EFFECTDAY_DATE_TYPE = 2;
    /**
     * 满数量减
     */
    public static final Short NUM_FULL_CONDITION = 2;
    /**
     * 金额计算折扣
     */
    public static final Integer AMOUNT = 100;
    /**
     * 默认参与活动次数
     */
    public static final int DEFAULT_JOIN_COUNT = 1;
    /**
     * 默认成功使用coupon状态
     */
    public static final int SUCCESS_USE_COUPON = 0;
    /*
	 * Coupon分类ID
	 * -------------------------------------END------------------------------
	 */
    /**
     * 本店售价模板ID
     */
    public static final Integer PRICE_TEMPLATE_ID_SHOP = -1;
    /**
     * 系统coupon
     */
    public static final String SYSTEM_COUPON="-1";
    /**
     * 普通coupon
     */
    public static final String NORMAL_COUPON="0";
    /**
     * 清仓价模板ID
     */
    public static final Integer PRICE_TEMPLATE_ID_CLEAR = -2;
    /**
     * 清仓价模板ID
     */
    public static final String PRICE_TEMPLATE_ID_PARTS = "-3";
    /**
     * 商品状态：清仓标识 3
     */
    public static final Integer CLEAR_STATUS = 3;
    /**
     * 清仓价priceId
     */
    public static final String CLEAR_PRICE_PRICE_ID = "1000000000000000001";
    /**
     * 清仓价priceName
     */
    public static final String CLEAR_PRICE_PRICE_NAME = "clear price";
    /**
     * 本店售价priceId
     */
    public static final String SHOP_PRICE_PRICE_ID = "1000000000000000000";
    /**
     * 本店售价priceName
     */
    public static final String SHOP_PRICE_PRICE_NAME = "shop price";
    /**
     * 默认开始时间
     */
    public static final Long DEFAULT_START_TIME = 0L;
    /**
     * 默认结束时间
     */
    public static final Long DEFAULT_END_TIME = 0L;
    /**
     * 默认利润率
     */
    public final static BigDecimal DEFAULT_RATES = BigDecimal.ONE;
    /**
     * 默认积分比率
     */
    public static final BigDecimal DEFAULT_INTEGRAL_RATE = BigDecimal.ONE;
    /**
     * 严格限价
     */
    public static final int STRICT_LIMIT = 2;
    /**
     * 默认使用数量
     */
    public static final long DEFAULT_USE_QTY = 0;
    /**
     * 默认最大销售数量
     */
    public static final int DEFAULT_MAX_SALE_QTY = Integer.MAX_VALUE;
    /**
     * 可用
     */
    public static final int IS_VALID = 1;
    /**
     * 不可用
     */
    public static final int NOT_VALID = 0;
    /**
     * 店铺系统coupon
     */
    public static final int SHOP_SYSTEMCOUPON_TYPE=2;
    /**
     * 支付折扣已启用
     */
    public static final int PAY_DISCOUNT_VALID = 1;
	/* -------------------------------Activity----------------------------- */
    /**
     * 指定不参与优惠默认活动ID
     */
    public static final String DEFAULT_GIVEUP_PROMOTION_ACTIVITYID = "0";

    /**
     * 默认不开启后置礼包的活动ID
     */
    public static final String DEFAULT_ACTIVITYID = "0";

    /**
     * coupon批量缓存
     */
    public static final int COUPON_SIZE = 300;
    /**
     * 活动折扣不封顶
     */
    public static final int ACTIVITY_DISCOUNT_UP = 0;
    /**
     * 无赠品,无换购商品
     */
    public static final int GIFT_FLAG_NONE = 0;
    /**
     * 有赠品
     */
    public static final int GIFT_FLAG_GOOD = 1;
    /**
     * 有换购商品
     */
    public static final int GIFT_FLAG_REDEMPTION = 2;
    /**
     * 商品类型：正常
     */
    public static final int GOOD_TYPE_NORMAL = 0;
    /**
     * 商品类型：配件
     */
    public static final int GOOD_TYPE_PARTS = 1;
    /**
     * 商品类型：赠品
     */
    public static final int GOOD_TYPE_FREEZEE = 2;
    /**
     * 商品类型：换购商品
     */
    public static final int GOOD_TYPE_REDEMPTION = 3;
    /**
     * goodsStyle：普通商品
     */
    public static final int GOOD_STYLE_NORMAL = 1;
    /**
     * goodsStyle：福袋商品
     */
    public static final int GOOD_STYLE_COMBINATION = 2;
    /**
     * 商品类型：买即赠赠品
     */
    public static final int GOOD_TYPE_BUYGIVEGIFT = 21;

    /**
     * 可用coupon
     */
    public static final int CAN_USE_COUPON = 1;
    /**
     * 已过期
     */
    public static final int COUPON_OVERDUE = 2;
    /**
     * 已使用完
     */
    public static final int USED_COUPON = 0;
    /**
     * 按百分比过滤
     */
    public static final int FILTER_PERCENT = 1;
    /**
     * 按金额过滤
     */
    public static final int FILTER_AMOUT = 2;
    /**
     * 按一口价过滤
     */
    public static final int FILTER_FIXEDPRICE = 3;
    /**
     * 按更新时间排序
     */
    public static final int SORT_UPDATETIME = 1;
    /**
     * 按过期时间排序
     */
    public static final int SORT_ENDTIME = 2;
    /**
     * 默认显示配件数量
     */
    public static final int DEFAULT_PARTS_SIZE = 10;
    /**
     * 会员设置积分类型
     */
    public static final int MEMBER_POINT_TYPE = 1;
    /**
     * 赠送积分key -积分/USD
     */
    public static final String MEMBER_POINT_AFFIRM = "affirm";

    /**
     * 满赠赠送配置节点
     */
    public final static String ACTIVITY_COMPLIMENTARY_NODE = "activityComplimentaryNode";

    /**
     * 满赠赠送配置节点生效节点
     */
    public final static String IS_CHIOSE = "isChiose";

    /**
     * 满赠赠送配置节点生效节点
     */
    public final static String EFFECT_ACTIVITY = "effectActivity";
    /**
     * 支付抵现key -积分/USD
     */
    public static final String MEMBER_POINT_PAY = "pay";
    /**
     * 购物车页面最大可用积分限制 key
     */
    public static final String MEMBER_POINT_INTEGRALLIMIT = "integralLimit";
    /**
     * 购物车页面支付抵现最小使用额度 key
     */
    public static final String MEMBER_POINT_MINFORCASHLIMIT = "minForCashLimit";
    /**
     * 配件绑定类别 1主商品SKU 2分类ID
     */
    public static final Short PART_BIND_GOOD_SN = 1;
    public static final Short PART_BIND_CATEGORY_ID = 2;
    /**
     * 赠品价priceId
     */
    public static final String GIFT_PRICE_ID = "1000000000000000003";
    /**
     * 加价购价priceId
     */
    public static final String REDEMPTION_PRICE_ID = "1000000000000000004";

    /**
     * 优先级默认最大值
     */
    public static final Integer MAX_PRIORITY_VALUE = 9999;

    /**
     * 赠送规则(订单赠送)
     * 兑换赠送积分
     */
    public static final Integer ORDER_GAIN = 2001;

    /**
     * 默认主体值(平台)
     */
    public static final String SPONSOR_DEFAULT_TYPE = "0";

    /**
     * 积分规则
     */
    public static final String PROMOTION_INTEGRAL_RULE = "promo:i:r";

    /**
     * 积分规则名称
     */
    public static final String INTEGRAL_RULE = "integralRule";
	/**
	 * 领取开始时间
	 */
	public static final String RECEIVE_START_TIME="receiveStartTime";
    /**
     * 领取结束时间
     */
    public static final String RECEIVE_END_TIME="receiveEndTime";
    /**
     * 裂变红包缓存前缀
     */
    public static final String RED_PACKET_ACTIVITY = "promo:a:rp";

    /**
     * 裂变红包用户已发起次数前缀
     */
    public static final String RED_PACKET_ACTIVITY_USRR_COUNT = "promo:a:rp:u:c";

    /**
     * 裂变红包用户已助力次数前缀
     */
    public static final String RED_PACKET_ACTIVITY_ASSIT_COUNT = "promo:a:rp:assit:c";

    /**
     * 裂变红包IMEI已使用次数前缀 (助力记录)
     */
    public static final String RED_PACKET_ACTIVITY_IMEI_COUNT = "promo:a:rp:imei:c";

    /**
     * 裂变红包IMEI已使用次数前缀 (发起记录)
     */
    public static final String RED_PACKET_ACTIVITY_IMEI_CREATE_COUNT = "promo:a:rp:imei:create:c";

    /**
     * 裂变红包用户已提现次数前缀
     */
    public static final String RED_PACKET_ACTIVITY_WITHDRAW_COUNT = "promo:a:rp:wd:c";

    /**
     * 裂变红包IMEI已提现次数前缀
     */
    public static final String RED_PACKET_ACTIVITY_IMEI_WITHDRAW_COUNT = "promo:a:rp:imei:wd:c";

    /**
     * 裂变红包用户助力名单列表
     */
    public static final String RED_PACKET_ACTIVITY_ASSIST_USRRS = "promo:a:rp:users";

    /**
     * 裂变红包IMEI助力名单列表
     */
    public static final String RED_PACKET_ACTIVITY_ASSIST_IMEIS = "promo:a:rp:imeis";

    /**
     * 助力活动已提现记录key
     * */
    public static final String RED_PACKET_ACTIVITY_WITHDRAW_RECODE = "promo:a:rp:withdraw";
    /**
     * 提现轮播列表(总金额)key
     * */
    public static final String RED_PACKET_ACTIVITY_WITHDRAW_AMOUNT_RECODE = "promo:a:rp:w:a";
    /**
     * 当前用户已拆金额
     */
    public static final String RED_PACKET_ACTIVITY_USRR = "promo:a:rp:u";

    /**
     * 当前用户发起的正在生效的红包
     */
    public static final String RED_PACKET_ACTIVITY_USRR_RECORD = "promo:a:rp:ur";

    /**
     * 当前设备IMEI发起的正在生效的红包
     */
    public static final String RED_PACKET_ACTIVITY_IMEI_RECORD = "promo:a:rp:imeir";

    /**
     * 裂变红包首拆次数
     */
    public static final String RED_PACKET_ACTIVITY_ASSIST_TOP_ONE_COUNT = "promo:a:rp:top:c";

    /**
     * 裂变红包锁缓存前缀
     */
    public static final String RED_PACKET_LOCK = "promo:a:rp:l";

    /**
     * 裂变红包首拆锁
     */
    public static final String RED_PACKET_ACTIVITY_ASSIST_TOP_ONE_LOCK = "promo:a:rp:top:l";

    /**
     * 裂变红包提现锁
     */
    public static final String RED_PACKET_WITHDRAW_LOCK = "promo:a:rp:w:l";

    /**
     * 表示所有的数字常量标识
     */
    public static final Number DEFAULT_NUMBER_ALL=-10000;

    /**
     * 抽奖流量控制开关
     */
    public static final String RAFFLE_LIMIT_SWITCH = "promotion.raffle.limiting";

    /**
     * redis多实例拆分开关
     */
    public static final String NAMESPACE_SWITCH_OFF = "off";

    /**
     * 适用所有店铺的系统coupon本地缓存
     */
    public static final String COUPON_SHOP_ALL_LOCALCACHE_KEY="guave_promo:s:c:GB:ALL";

    /**
     * 适用所有店铺的系统coupon本地缓存(kaiping)
     */
    public static final String COUPON_SHOP_ALL_GUAVA_OPENPLATFORM="guave_promo_op:s:c:GB:ALL";

    /**
     * 整型数据默认值
     */
    public static final Integer DEFAULT_INTEGER_VALUE = 9999;
    /**
     * 预生成coupon缓存key
     */
    public static final String COUPON_PRE_BUILD_KEY="promo:u:c:b";
    /**
     * coupon领取防恶意刷缓存key
     */
    public static final String COUPON_COUNT_KEY="promo:c:c:l";

    /**
     * 第三方默认仓库编码
     */
    public static final String DEFAULT_WAREHOUSE_CODE = "0";

    /**
     * ALL:店铺、分类、商品、品牌ALL
     */
    public static final String ALL = "ALL";

    /**
     * 参数限制-券码最大长度
     */
    public static final String COUPON_PARAM_CODE_LENGTH="coupon.param.code.length";

    /**
     * 参数限制-店铺最大长度
     */
    public static final String COUPON_PARAM_SHOP_LENGTH="coupon.param.shop.length";
    /**
     * 活动不带状态的key的前缀
     */
    public static final String PROMOTION_ACTIVITY_WITHOUT_STATUS = "promo:a:ws";

    /**
     * coupon不带状态的key前缀
     */
    public static final String PROMOTION_COUPON_WITHOUT_STATUS = "promo:c:ws";

    /**
     * 活动类型优先级排序
     */
    public static final String ACTIVITY_TYPE_PRIORITY = "promo:a:pri";

    /**
     * 已优惠总金额key前缀:promotion:count:reduce:amount
     */
    public static final String PROMOTION_REDUCE_AMOUNT_KEY = "promo:c:r:a";

    /**
     * 领取奖品锁
     */
    public static final String PROMOTION_RAFFLE_GIVE_PRIZE_LOCK = "promo:r:gp:l";

    /**
     *redis key永久有效
     */
    public static final int PERMANENT_FOR_REDIS_KEY=-1;

    public static final String STRING_ON="on";

    public static final String STRING_OFF="off";

    /**
     * 重构活动上线的业务开关（默认关闭）
     */
    public static final String ACTIVITY_RECONFIGURATION_SWITCH="activity.reconfiguration.switch";

    /**
     * 重构活动写旧缓存开关（默认开启）
     */
    public static final String ACTIVITY_WRITE_OLD_RULE_CAHCE_SWITCH="activity.write.old.rule.cache.switch";
}